home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d8 / qns310.arc / Q-LOGON.SCR < prev    next >
Text File  |  1991-04-28  |  8KB  |  163 lines

  1. ;┌──────────────────────────────────────────────────────────────────────────┐
  2. ;│ Q-LOGON.SCR        Copyright 1988-1990 by Rik Brown                      │
  3. ;│                                                                          │
  4. ;│                    Log on script                                         │
  5. ;└──────────────────────────────────────────────────────────────────────────┘
  6.  
  7.   ASSIGN 6 0                            ; Set 0 = 1st time or carrier drop
  8.  
  9. DIALSEQUENCE:
  10.  
  11.   HANGUP                                ; Drop any prior connection
  12.   IF "$0" >=  "$maxdial"         LOGOFF ; Check max # of dial attempts
  13.   IF "$1" >=  "$maxconn"         LOGOFF ; Check max # of handshake attempts
  14.   IF "$4" >= "$maxulmail"        LOGOFF ; Quit if max UL attempts reached
  15.   IF "$3" >= "$maxdlmail"        LOGOFF ; Quit if max DL attempts reached
  16.   INCR 0                                ; Dials Counter
  17.   IF "$6" = "0"          INITIAL_SCREEN ; Setup screen if carrier drop
  18.   IF "$0" >= "2"          UPDATE_SCREEN ; Update Screen if Dial is 2 or greater
  19.  
  20. INITIAL_SCREEN:
  21.  
  22.   INCR 6                                ; Flag to indicate first attempt
  23.                                         ; (1st attempt after carrier loss, too)
  24.   ATWRITE 1  1 $scrcolor  "┌──────────────────────────────────────────────────────────────────────────────┐"
  25.   ATWRITE 1  2 $scrcolor  "│                                                                              │"
  26.   ATWRITE 29 2 $titlecolor "QNS v3.10 (11/27/90)"
  27.   ATWRITE 1  3 $scrcolor  "│                                                                              │"
  28.   ATWRITE 23 3 $titlecolor "Copyright 1988-1990 by Rik Brown"
  29.   ATWRITE 1  4 $scrcolor  "├──────────────────────────────────────────────────────────────────────────────┤"
  30.   ATWRITE 1  5 $scrcolor  "│                        Calling to:                                           │"
  31.   ATWRITE 38 5 $titlecolor "$bbsname"
  32.   ATWRITE 1  6 $scrcolor  "│                       Will upload:                                           │"
  33.   ATWRITE 38 6 $titlecolor "$2 $mailUL"
  34.   ATWRITE 1  7 $scrcolor  "│                                                                              │"
  35.   ATWRITE 1  8 $scrcolor  "│                           Phone 1:                                           │"
  36.   ATWRITE 38 8 $titlecolor "$phone1"
  37.   ATWRITE 1  9 $scrcolor  "│                           Phone 2:                                           │"
  38.   ATWRITE 38 9 $titlecolor "$phone2"
  39.   ATWRITE 1 10 $scrcolor  "│                                                                              │"
  40.   ATWRITE 1 11 $scrcolor  "│   STARTED:          on                        Handshake attempts:            │"
  41.   ATWRITE 1 12 $scrcolor  "│   CURRENT:          on                          Dialing attempts:            │"
  42.   ATWRITE 1 13 $scrcolor  "├──────────────────────────────────────────────────────────────────────────────┤"
  43.   ATWRITE 1 14 $scrcolor  "│         The latest version of QNS is available at TRAVEL ONLINE BBS          │"
  44.   ATWRITE 1 15 $scrcolor  "│       30,000 Files & 140+ Conferences with Upload Credits for Messages       │"
  45.   ATWRITE 1 16 $scrcolor  "│         (314) 973-4073 Hayes v.32 ■ St. Louis, MO (PC-Pursuit)               │"
  46.   ATWRITE 1 17 $scrcolor  "│         (314) 625-4045 Hayes v.32 ■ St. Charles, MO (Contel)                 │"
  47.   ATWRITE 1 18 $scrcolor  "└──────────────────────────────────────────────────────────────────────────────┘"
  48.  
  49. GOTOXY 1 1
  50.   GETSCR
  51.  
  52.   UPDATE_SCREEN:
  53.  
  54.   GOTOXY 1 1
  55.   PUTSCR
  56.   ATWRITE 14 11 $startcolor   "$stime"
  57.   ATWRITE 26 11 $startcolor   "$sdate"
  58.   ATWRITE 69 11 $startcolor   "$1 of $maxconn"
  59.   ATWRITE 14 12 $currentclr   "$time"
  60.   ATWRITE 26 12 $currentclr   "$date"
  61.   ATWRITE 69 12 $currentclr   "$0 of $maxdial"
  62.   IF "$5" = "1" PHONE1
  63.   IF "$5" = "2" PHONE2
  64.  
  65.   PHONE1:
  66.  
  67.     ATWRITE 27 9 $scrcolor " "
  68.     ATWRITE 27 8 $scrcolor ">"
  69.     GOTO DIAL_ROTATE
  70.  
  71.   PHONE2:
  72.  
  73.     ATWRITE 27 8 $scrcolor " "
  74.     ATWRITE 27 9 $scrcolor ">"
  75.     GOTO DIAL_ROTATE
  76.  
  77. DIAL_ROTATE:
  78.  
  79.   GOTOXY  1 19
  80. ; Following NOTE lines end with alt-255 which is required (do not change)
  81.   NOTE                                                           
  82.   NOTE                                                           
  83.   NOTE                                                           
  84.   NOTE                                                           
  85.   NOTE                                                           
  86.   GOTOXY  1 19
  87.  
  88.   IF "$5" = "1" DIAL1                   ; if counter = 1 go to dial 1
  89.   IF "$5" = "2" DIAL2                   ; if counter = 1 go to dial 2
  90.   IF "$5" = "3" DIAL1                   ; if counter = 3 go to dial 1
  91.  
  92.   DIAL1:
  93.     ASSIGN 5 1                          ; reset counter to 1 if = 3
  94.     SEND "^~^~^~^~ATDT $PHONE1^M"       ; call phone1
  95.     INCR 5                              ; Increase counter: dial rotation
  96.     GOTO DIAL_CONNECT
  97.  
  98.   DIAL2:
  99.     SEND "^~^~^~^~ATDT $PHONE2^M"       ; call phone2
  100.     INCR 5                              ; Increase counter: dial rotation
  101.     GOTO DIAL_CONNECT
  102.  
  103. DIAL_CONNECT:
  104.  
  105.   WHEN                                  ; Clear all WHENs
  106.   WHEN "RING"              DIALSEQUENCE ; Redial if incoming call rings
  107.   WHEN "BUSY"              DIALSEQUENCE ; Redial if BUSY message
  108.   WHEN "NO DIALTONE"       DIALSEQUENCE ; Redial if NO DIALTONE message
  109.   WHEN "NO CONNECT"        DIALSEQUENCE ; Redial if NO CONNECT message
  110.   WHEN "NO CARRIER"        DIALSEQUENCE ; Redial if NO CARRIER message
  111.  
  112.   TIMEOUT 60                CARRIERDROP ; Redial if no carrier within 60 secs
  113.   WAITFOR "CARRIER $minbaud"            ; (Keep 60 secs or can fail)
  114.  
  115.   INCR 1                                ; Increase handshake counter by 1
  116.  
  117.   NOTE                                                                       
  118.   NOTE ----------------------------------------------------------------------
  119.   NOTE ATTEMPT STATS: DIALS ($0) HANDSHAKES ($1) TIME ($TIME $DATE)
  120.   NOTE ----------------------------------------------------------------------
  121.   NOTE                                                                       
  122.  
  123. ; ALT-255 at end of 1st and last NOTE line above (do not alter)
  124.  
  125. ; If the script has executed this far a CARRIER has been detected. The
  126. ; following sequence ensures the minimum connect baud rate occurs.
  127.  
  128.   WHEN                                  ; Clear all WHENs
  129.   WHEN "ÇÇÇÇÇÇÇÇÇÇÇÇ"      DIALSEQUENCE ; Reject improper connect
  130.   WHEN "NO CARRIER"         CARRIERDROP ; Redial if carrier drops
  131.   WHEN "(Enter)=no change?" "^~^~$language^M"    ; Use PCB Script Prompts
  132.  
  133.   TIMEOUT 10                        MNP ; Handling for BBS MNP modems
  134.   WAITFOR "(Enter)=no?"
  135. MNP:
  136.   SEND "^~^~N Q^M"                     ; Non-graphic & quick log on
  137.  
  138. ; Once the script has executed this far then the following lines will take
  139. ; us up to the Command prompt.
  140.  
  141.   WHEN
  142.   WHEN "first name?"              "^~^~$names^M" ; Send first & last name
  143.   WHEN "try again ..."            "^~^~$names^M" ; Resend names if garbled
  144.   WHEN "(Dots will echo)?"        "^~^~$pword^M" ; Send password
  145.   WHEN "password entered!"        "^~^~$pword^M" ; Resend password if garbled
  146.   WHEN "orrect?"                  "^~Y^M"        ; Correct city prompt
  147.   WHEN "(H)elp, More?"            "^~N^M"        ; Avoid successive screens
  148.   WHEN "(Enter)"                  "^~N^M"        ; Avoid successive screens
  149.   WHEN "Access Denied"                    LOGOFF ; LOGOFF if access denied
  150.   WHEN "Time Limit Exceeded"              LOGOFF ; LOGOFF if time exceeded
  151.   WHEN "NO CARRIER"                  CARRIERDROP ; Redial if carrier drops
  152.  
  153.   TIMEOUT 60                        DIALSEQUENCE ; Wait max 60 secs for
  154.   WAITFOR "ommand?"                              ; Command prompt
  155.  
  156.   WHEN                                           ; Clear all WHENS
  157.   RETURN                                         ; Return to calling script
  158.  
  159. CARRIERDROP:
  160.   SCRIPT $CMDSCRIPT
  161. LOGOFF:
  162.   SCRIPT Q-LOGOFF.SCR
  163.